package com.power.bank.member.service.impl;

import java.util.List;
import com.power.bank.common.utils.DateUtils;
import com.power.bank.member.domain.PbMemberAccount;
import com.power.bank.member.mapper.PbMemberAccountMapper;
import com.power.bank.member.service.IPbMemberAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 会员账号Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-13
 */
@Service
public class PbMemberAccountServiceImpl implements IPbMemberAccountService
{
    @Autowired
    private PbMemberAccountMapper pbMemberAccountMapper;

    /**
     * 查询会员账号
     * 
     * @param id 会员账号主键
     * @return 会员账号
     */
    @Override
    public PbMemberAccount selectPbMemberAccountById(Long id)
    {
        return pbMemberAccountMapper.selectPbMemberAccountById(id);
    }

    @Override
    public PbMemberAccount selectPbMemberAccountByAccount(String account, String type) {
        return pbMemberAccountMapper.selectPbMemberAccountByAccount(account,type);
    }

    /**
     * 查询会员账号列表
     * 
     * @param pbMemberAccount 会员账号
     * @return 会员账号
     */
    @Override
    public List<PbMemberAccount> selectPbMemberAccountList(PbMemberAccount pbMemberAccount)
    {
        return pbMemberAccountMapper.selectPbMemberAccountList(pbMemberAccount);
    }

    /**
     * 新增会员账号
     * 
     * @param pbMemberAccount 会员账号
     * @return 结果
     */
    @Override
    public int insertPbMemberAccount(PbMemberAccount pbMemberAccount)
    {
        pbMemberAccount.setCreateTime(DateUtils.getNowDate());
        return pbMemberAccountMapper.insertPbMemberAccount(pbMemberAccount);
    }

    /**
     * 修改会员账号
     * 
     * @param pbMemberAccount 会员账号
     * @return 结果
     */
    @Override
    public int updatePbMemberAccount(PbMemberAccount pbMemberAccount)
    {
        pbMemberAccount.setUpdateTime(DateUtils.getNowDate());
        return pbMemberAccountMapper.updatePbMemberAccount(pbMemberAccount);
    }

    /**
     * 批量删除会员账号
     * 
     * @param ids 需要删除的会员账号主键
     * @return 结果
     */
    @Override
    public int deletePbMemberAccountByIds(Long[] ids)
    {
        return pbMemberAccountMapper.deletePbMemberAccountByIds(ids);
    }

    /**
     * 删除会员账号信息
     * 
     * @param id 会员账号主键
     * @return 结果
     */
    @Override
    public int deletePbMemberAccountById(Long id)
    {
        return pbMemberAccountMapper.deletePbMemberAccountById(id);
    }
}
